#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define BUF_SIZE 200

int main() {
  FILE *read_fp;
  char buffer[BUF_SIZE + 1];
  int chars_read;
  memset(buffer, '\0', sizeof(buffer));

  read_fp = popen("uname -a", "r");
  if (read_fp != NULL) {
    chars_read = fread(buffer, sizeof(char), BUF_SIZE, read_fp);
    if (chars_read > 0) {
      printf("Output was:-\n%s\n", buffer);
    }
    pclose(read_fp);
    return 0;
  }

  return 0;
}
